<?php $this->load('header')?>

<?php $this->showTabs() ?>

<div class="main">

		<div class="search">
			<form name="search" method="post" action="<?php echo URL('link.index')?>">
				<fieldset>
					<legend>链接查找</legend>
						关键字：
						<input type="text" name="keyword" size="15" value="<?php echo $keyword?>" />
						<input type="submit" name="s" class="button" value="开始查找" />
						<input type="button" class="button" value="显示所有" onclick="window.location.href='<?php echo URL('link.index')?>'" />
						<input type="button" class="button" value="添加连接" onclick="window.location.href='<?php echo URL('link.add')?>'" />
				</fieldset>
			</form>
		</div>
		<form name="update" method="post" action="?mod=link">
			<table class="datalist" cellspacing="0" id="list">
				<tr>
					<th width="50" class="firstcol">选择</th>
					<th width="150">名称</th>
					<th>链接</th>
					<th width="100">分类</th>
					<th width="80">状态</th>
					<th width="80">排序</th>
					<th width="80">操作</th>
				</tr>
				<?php 
				if ( $result ) {
					foreach ($result as $row) {
				?>
				<tr id="row_<?php echo $row['id']?>">
					<td align="center"><input type="checkbox" name="id[]" value="<?php echo $row['id']?>" class="checkbox" /></td>
					<td><a href="?mod=link&ac=edit&id=<?php echo $row['id']?>"><?php echo $row['name']?></a></td>
					<td><a href="<?php echo $row['url']?>" target="_blank"><?php echo $row['url']?></a></td>
					<td align="center"><a href="?mod=link&cateid=<?php echo $row['cateid']?>"><?php echo $row['catename']?></a></td>
					<td align="center"><?php echo $row['status'] ? '<a href="?mod=link&ac=upstat&id='.$row['id'].'&val=0" class="suc">通过</a>' : '<a href="?mod=link&ac=upstat&id='.$row['id'].'&val=1" class="err">未审核</a>'?></td>
					<td align="center"><input type="text" name="order[<?php echo $row['id']?>]" value="<?php echo $row['orderid']?>" size="5" class="input" /></td>
					<td align="center"><a href="?mod=link&ac=edit&id=<?php echo $row['id']?>">编辑</a></td>
				</tr>
				<?php
					}
				} else {
					echo '<tr><td colspan="10">暂无记录...</td></tr>';
				}
				?>
				<tr>
					<td align="center"><input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" /></td>
					<td colspan="8">全选 
					<input type="radio" name="ac" value="resort" id="resort" class="radio" checked="checked" onclick="$('#span_move').hide()" /><label for="resort">排序</label> 
					<input type="radio" name="ac" value="del" id="del" class="radio" onclick="$('#span_move').hide()" /><label for="del">删除</label> 
					<input type="radio" name="ac" value="move" id="move" class="radio" onclick="$('#span_move').show()" /><label for="move">移动到</label>
					<span id="span_move" style="display:none">
					<select name="cateid">
						<option value="">请选择</option>
						<?php $this->showCateOptions('link')?>
					</select>
					</span>
					<input type="submit" class="submit" value="执行操作"/>
				</tr>
				<tr>
					<td colspan="10"><?php echo $pagebar?></td>
				</tr>
			</table>
		</form>
	

</div>

<?php $this->load('footer')?>